HttpMessage

class HttpMessage {}

Constructors

this
this()
Undocumented in source.
this
this(HttpMessageType messageType)
Undocumented in source.

Members

Functions

addHeader
void addHeader(HTTPHeaderCode code, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
addHeader
void addHeader(string name, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
constructDirectResponse
void constructDirectResponse(ubyte maj, ubyte min, int statucode, string statusMsg, int contentLength)

Fill in the fields for a response message header that the server will send directly to the client.

constructDirectResponse
void constructDirectResponse(ubyte maj, ubyte min, int contentLength)

Fill in the fields for a response message header that the server will send directly to the client. This function assumes the status code and status message have already been set on this HTTPMessage object

getClientIP
string getClientIP()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientPort
string getClientPort()
Undocumented in source. Be warned that the author may not have intended to support it.
getDecodedQueryParam
string getDecodedQueryParam(string name)

Get the query parameter with the specified name after percent decoding.

getDstIP
string getDstIP()
Undocumented in source. Be warned that the author may not have intended to support it.
getDstPort
string getDstPort()
Undocumented in source. Be warned that the author may not have intended to support it.
getHTTPVersion
auto getHTTPVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
getHeaders
HttpHeaders getHeaders()

Access the headers (fpreq, fpres)

getPath
string getPath()

Access the path component (fpreq)

getProtocolVersion
string getProtocolVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
getQueryParam
string getQueryParam(string name, string defaults)

Get the query parameter with the specified name.

getQueryString
string getQueryString()

Access the query component (fpreq)

hasQueryParam
bool hasQueryParam(string name)

Check if query parameter with the specified name exists.

is1xxResponse
bool is1xxResponse()

Returns true if this is a 1xx response.

isHTTP1_0
bool isHTTP1_0()

Returns true if the version of this message is HTTP/1.0

isHTTP1_1
bool isHTTP1_1()

Returns true if the version of this message is HTTP/1.1

isRequest
bool isRequest()

@returns true if this HTTPMessage represents an HTTP request

isResponse
bool isResponse()

@returns true if this HTTPMessage represents an HTTP response

methodString
string methodString()
Undocumented in source. Be warned that the author may not have intended to support it.
parseQueryParams
void parseQueryParams()
Undocumented in source. Be warned that the author may not have intended to support it.
processMaxForwards
int processMaxForwards()

Decrements Max-Forwards header, when present on OPTIONS or logDebug methods.

queryParam
string[string] queryParam()

Get the query parameter with the specified name after percent decoding.

queryParam
void queryParam(string[string] v)
Undocumented in source. Be warned that the author may not have intended to support it.
removeQueryParam
void removeQueryParam(string name)

Remove the query parameter with the specified name.

request
Request request()
Undocumented in source. Be warned that the author may not have intended to support it.
response
Response response()
Undocumented in source. Be warned that the author may not have intended to support it.
setHTTPVersion
void setHTTPVersion(ubyte maj, ubyte min)
Undocumented in source. Be warned that the author may not have intended to support it.
setHeader
void setHeader(HTTPHeaderCode code, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
setHeader
void setHeader(string name, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
setQueryParam
void setQueryParam(string name, string value)

Sets the query parameter with the specified name to the specified value.

setQueryString
void setQueryString(string query)

Set the query string to the specified value, and recreate the url_.

unparseQueryParams
void unparseQueryParams()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

chunked
bool chunked [@property setter]

Is this a chunked message? (fpreq, fpresp)

chunked
bool chunked [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
clientAddress
Address clientAddress [@property setter]

Set/Get client address

clientAddress
Address clientAddress [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
dstAddress
Address dstAddress [@property setter]

Set/Get destination (vip) address

dstAddress
Address dstAddress [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
host
string host [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
localIp
string localIp [@property setter]

Set/Get the local IP address

localIp
string localIp [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
method
HTTPMethod method [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
method
HTTPMethod method [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
statusCode
ushort statusCode [@property setter]

Access the status code (fpres)

statusCode
ushort statusCode [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
statusMessage
string statusMessage [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
statusMessage
string statusMessage [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
upgraded
bool upgraded [@property setter]

Is this an upgraded message? (fpreq, fpresp)

upgraded
bool upgraded [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
url
string url [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
url
string url [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
wantsKeepAlive
wantsKeepAlive [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
wantsKeepAlive
bool wantsKeepAlive [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

statusText
string statusText(int code)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Request
struct Request

The 12 standard fields for HTTP messages. Use accessors. An HTTPMessage is either a Request or Response. Once an accessor for either is used, that fixes the type of HTTPMessage. If an access is then used for the other type, a DCHECK will fail.

Response
struct Response
Undocumented in source.

Unions

Req_Res
union Req_Res
Undocumented in source.

Variables

kMaxPriority
enum byte kMaxPriority;
Undocumented in source.

Meta